package com.xiu.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xiu.mapper.ExamUserMapper;
import com.xiu.pojo.ExamUser;

@Service
public class ExamUserService {
	@Autowired
	ExamUserMapper examUserMapper;
	
	//查找全部
	public List<ExamUser> findAllExamUser(int examRoleId){
		return examUserMapper.findAll(examRoleId);
	}
	
	//通过ID查找
		public ExamUser selectExamStu(int examStuId){
			return examUserMapper.selectByPrimaryKey(examStuId);
		}
	
	//增加
	public int insertUser(ExamUser examUser){
		return examUserMapper.insert(examUser);
	}
	
	//删除
	public int deleteExamStu(int examStuId){
		return examUserMapper.deleteByPrimaryKey(examStuId);
	}
	
	//修改
	public int updateExamStu(ExamUser examUser){
		return examUserMapper.updateByPrimaryKey(examUser);
	}
	
	//查找学号是否存在
	public int findExamNumber(int examNumber){
		return examUserMapper.findNumber(examNumber);
	}
	
	//
	public ExamUser findUserNumber(int examNumber){
		return examUserMapper.findUserNumber(examNumber);
	}
}
